<?php
class Mod_general extends CI_Model
{
    function __construct()
    {
        parent::__construct();
		$this->load->model("engine/pass_word");
    }
	
	function get_template_name($path)
	{
//		if(is_file($path))
		{
			$cont	= file($path);
			foreach($cont as $c)
				return $c;
		}
		return "klorofil";
	}

	function get_banner_size($path)
	{
		$ar_ret	= array("w"=>0, "h"=>0);
//		if(is_file($path))
		{
			$cont	= file($path);
			foreach($cont as $c)
			{
				if(substr_count($c, "FRONT BANNER WIDTH")>0)
				{
					$ar_ret['w']	= substr($c,0, strpos($c,';'));
				}
				if(substr_count($c, "FRONT BANNER HEIGHT")>0)
				{
					$ar_ret['h']	= substr($c,0, strpos($c,';'));
				}
			}
		}
		return $ar_ret;
	}
	
	function get_theme_setting($path, $param)
	{
		$cont	= file($path);
		foreach($cont as $c)
		{
			if(substr_count($c, $param)>0)
			{
				return substr($c,0, strpos($c,';'));
			}
		}
		return "";
	}
	
	function get_web_setting($param)
	{
		$sql	= "SELECT
					value
					FROM tbl_web_config
					WHERE param = '$param'";
		$rec	= $this->db->query($sql);
		$res	= $rec->result_array();
		if($rec->num_rows()>0)
			return $res[0]['value'];
		return "";
	}
}